<template>
  <div>
    <citheader />
    <jingnei :cities="cities" />
    <paixu :hotCities="hotCities" :cities="cities" :letter="letter" />
    <alphabet @change="change" :cities="cities" />
  </div>
</template>

<script>
import axios from "axios";
import citheader from "@/pages/city/components/citheader";
import jingnei from "@/pages/city/components/jingnei";
import paixu from "@/pages/city/components/paixu";
import alphabet from "@/pages/city/components/alphabet";
export default {
  name: "",
  components: {
    citheader,
    jingnei,
    paixu,
    alphabet,
  },
  props: [],
  data() {
    return {
      hotCities: [],
      cities: {},
      letter: "",
    };
  },
  computed: {},
  watch: {},
  created() {},
  mounted() {
    this.getlist();
  },
  methods: {
    // 获取城市
    getlist() {
      axios.get("/static/mock/city.json").then((res) => {
        console.log(res.data.data.cities);
        this.hotCities = res.data.data.hotCities;
        this.cities = res.data.data.cities;
      });
    },
    // 接受传过来的值
    change(letter) {
      console.log(letter);
      this.letter = letter;
    },
  },
};
</script>

<style scoped>
html {
  overflow: none;
}
</style>
